// 搜索聊天信息单条显示
import 'package:cloud_medicine/model/author_basic_info.dart';

class SearchChatItem {
  final int chatID;
  final AuthorBasicInfo authorBasicInfo;
  final int recordNum;

  SearchChatItem({
    this.chatID,
    this.authorBasicInfo,
    this.recordNum,
  });

  factory SearchChatItem.init(Map<String, dynamic> json) {
    return SearchChatItem(
      chatID: json['chatid'],
      authorBasicInfo: AuthorBasicInfo.init(json['author']),
      recordNum: json['recordNum'],
    );
  }
}

List<SearchChatItem> SearchChatListModel = [
  new SearchChatItem.init({
    "chatID": 1,
    "author": {
      "id": 1,
      "avatar": "http://cloud-medicine.youchen-blog.cn/avatar.jpg",
      "realname": "用户1",
    },
    "recordNum": 2,
  }),
  new SearchChatItem.init({
    "chatID": 2,
    "author": {
      "id": 2,
      "avatar": "http://cloud-medicine.youchen-blog.cn/avatar.jpg",
      "realname": "用户2",
    },
    "recordNum": 1,
  }),
];